<template>
	<view class="sell_list">
		<Navbar>我的售卖</Navbar>
		<view class="tabs">
			<view class="item" :class="active==1?'active':''" @click="changeActive(1)">
				售卖中
			</view>
			<view class="item" :class="active==2?'active':''" @click="changeActive(2)">
				已出售
			</view>
		</view>
		<SellList :type="type" v-if="active==1"></SellList>
		<SoldList :type="type" v-else></SoldList>
	</view>
</template>

<script>
	import SellList from '@/components/home/SellList.vue';
	import SoldList from '@/components/home/SoldList.vue';

	export default {
		components: {
			SellList,
			SoldList
		},
		data() {
			return {
				active: 1,
				type: null
			}
		},
		onLoad(option) {
			this.type = option.type;
		},
		methods: {
			changeActive(index) {
				this.active = index;
			}
		}
	}
</script>

<style scoped lang="scss">
	.sell_list {
		height: 100vh;
		background: #29170D;
		overflow: hidden;

		.tabs {
			width: 710rpx;
			height: 100rpx;
			margin: 0 auto;
			padding: 0 10rpx;
			box-sizing: border-box;
			background-color: rgba(31, 11, 5, 0.6);
			display: flex;
			justify-content: center;
			align-items: center;

			.item {
				width: 180rpx;
				height: 70rpx;
				line-height: 70rpx;
				text-align: center;
				color: #FFFFFF;
				font-size: 36rpx;
				font-weight: 400;
				font-family: LiSu;
				margin: 0 60rpx;

				&.active {
					color: #494338;
					background: url(#{$baseImageUrl}/common/active.png) no-repeat;
					background-size: 100% 100%;
				}
			}
		}

		.scroll_view {}
	}
</style>